﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/AdminMasterPage.master" AutoEventWireup="true" CodeFile="quan-ly-thuc-don.aspx.cs" Inherits="Admin_quan_ly_thuc_don" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<h1>Quản lý loại món ăn</h1>
    <asp:GridView ID="grvLoaiMonAn" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="LoaiMonID" 
        onrowcancelingedit="grvLoaiMonAn_RowCancelingEdit" 
        onrowdeleting="grvLoaiMonAn_RowDeleting" onrowediting="grvLoaiMonAn_RowEditing" 
        onrowupdating="grvLoaiMonAn_RowUpdating">
        <Columns>
            <asp:TemplateField HeaderText="Loại Món Ăn">
                <ItemTemplate>
                    <asp:Label ID="lblTenLoaiMon" runat="server" Text='<%# Eval("TenLoaiMon") %>'></asp:Label></ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtLoaiMonAn" Text='<%# Eval("TenLoaiMon") %>' runat="server"></asp:TextBox></EditItemTemplate>
            </asp:TemplateField>
            <asp:CommandField ButtonType="Button" HeaderText="Sửa" ShowEditButton="True" />
            <asp:CommandField ButtonType="Button" HeaderText="Xóa" 
                ShowDeleteButton="True" />
        </Columns>
    </asp:GridView>
    <h1>Thêm Loại Món</h1>
    <span>Tên loại món</span><asp:TextBox ID="txtTenLoaiMon" runat="server"></asp:TextBox><asp:Button
        ID="btnOK" runat="server" Text="Thêm" onclick="btnOK_Click" />
        <h1>Quản lý thực đơn</h1>
        <span>Chọn nhà hàng</span><asp:DropDownList ID="ddlRes" runat="server" 
        AutoPostBack="true" onselectedindexchanged="ddlRes_SelectedIndexChanged">
        </asp:DropDownList><br />
    <asp:GridView ID="grvMenu" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="ThucDonID" onrowcancelingedit="grvMenu_RowCancelingEdit" 
        onrowdatabound="grvMenu_RowDataBound" onrowdeleting="grvMenu_RowDeleting" 
        onrowediting="grvMenu_RowEditing" onrowupdating="grvMenu_RowUpdating">
        <Columns>
            <asp:TemplateField HeaderText="Tên Món">
                <ItemTemplate>
                    <asp:Label ID="lblTenMon" runat="server" Text='<%# Eval("TenMon") %>'></asp:Label></ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtTenMon" Text='<%# Eval("TenMon") %>' runat="server"></asp:TextBox></EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Loại Món">
                <ItemTemplate>
                    <asp:Label ID="lblLoaiMon" runat="server" Text='<%#Eval("TenLoaiMon") %>'></asp:Label></ItemTemplate>
                    <EditItemTemplate>
                        <asp:DropDownList ID="ddlLoaiMon" runat="server">
                        </asp:DropDownList>
                    </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Đơn Gía">
                <ItemTemplate>
                    <asp:Label ID="lblPrice" runat="server" Text='<%#Eval("DonGia") %>'></asp:Label></ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtPrice" Text='<%#Eval("DonGia") %>' runat="server"></asp:TextBox>
                    </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Đơn Vị">
                <ItemTemplate>
                    <asp:Label ID="lblDonVi" runat="server" Text='<%#Eval("DonVi") %>'></asp:Label></ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtDonVi" Text='<%# Eval("DonVi") %>' runat="server"></asp:TextBox>
                    </EditItemTemplate>
            </asp:TemplateField>
            <asp:CommandField ButtonType="Button" HeaderText="Sửa" ShowEditButton="True" />
            <asp:CommandField ButtonType="Button" HeaderText="Xóa" 
                ShowDeleteButton="True" />
        </Columns>
    </asp:GridView><br />
    <h1>Thêm Món</h1>
    <span>Loại Món</span><asp:DropDownList ID="ddlLoaiMon" runat="server" 
        AutoPostBack="True" onselectedindexchanged="ddlLoaiMon_SelectedIndexChanged">
    </asp:DropDownList><br />
    <span>Tên Món</span><asp:TextBox ID="txtTenMon" runat="server"></asp:TextBox><span>Đơn Giá</span><asp:TextBox 
        ID="txtPrice" runat="server"></asp:TextBox><span>Đơn Vị</span><asp:TextBox ID="txtDonVi" runat="server"></asp:TextBox>
        <asp:Button
        ID="btnThemMon" runat="server" Text="Thêm Món" 
        onclick="btnThemMon_Click" />
</asp:Content>

